package com.ronds.webtest.steps;


import com.ronds.webtest.exception.CommonException;
import org.testng.annotations.Test;
import com.ronds.webtest.pages.LoginPage;

import static com.ronds.webtest.util.WebElementUtil.isExist;
import static com.ronds.webtest.util.WebElementUtil.takeErrorScreenshotAll;

@Test(groups = "test")
public class LoginStepDef {

    private GeneralStepDef generalStepDef = new GeneralStepDef();
    private LoginPage loginPage = new LoginPage();

    //登录boss系统
    @Test(groups = "All")
    public void checkLoginPage() {
        generalStepDef.login("测四", "k4@mk.com", "226226");
        if (isExist(loginPage.getXpathServiceErrorTag())) {
            takeErrorScreenshotAll();
            throw new CommonException("跳转至用户页面服务器出错");
        }
    }


}
